package com.slipper.system.api.menu.bo;

import java.util.Date;
import java.util.TreeSet;

import com.slipper.common.bo.CommonBO;

/**
 * 菜单信息表
 * 
 * @date 2019-10-03 14:09:46
 */
public class MenuBO extends CommonBO {
    private static final long serialVersionUID = 1L;

    /** 类型：4、页面类型 */
    public static final String TYPE_PAGE = "4";

    /* 菜单ID */
    private String id;
    /* 菜单ID */
    private String[] ids;
    /* 父菜单ID */
    private String parentId;
    /* vue路径 */
    private String vuePath;
    /* 菜单路径 */
    private String url;
    /* 菜单名称 */
    private String name;
    /* 菜单类型 */
    private String type;
    private String[] types;
    /* 排序 */
    private Integer ordinal;
    /* 是否有效 */
    private String valid;
    /* 创建时间 */
    private Date createTime;

    private String employeeId;
    private TreeSet<MenuPrivilegeBO> privileges = new TreeSet<>();

    public void setId(String id) {
        this.id = id;
    }

    public String getId() {
        return id;
    }

    public void setIds(String[] ids) {
        this.ids = ids;
    }

    public String[] getIds() {
        return ids;
    }

    public void setParentId(String parentId) {
        this.parentId = parentId;
    }

    public String getParentId() {
        return parentId;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String[] getTypes() {
        return types;
    }

    public void setTypes(String[] types) {
        this.types = types;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getUrl() {
        return url;
    }

    public String getVuePath() {
        return vuePath;
    }

    public void setVuePath(String vuePath) {
        this.vuePath = vuePath;
    }

    public void setOrdinal(Integer ordinal) {
        this.ordinal = ordinal;
    }

    public Integer getOrdinal() {
        return ordinal;
    }

    public void setValid(String valid) {
        this.valid = valid;
    }

    public String getValid() {
        return valid;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public String getEmployeeId() {
        return employeeId;
    }

    public void setEmployeeId(String employeeId) {
        this.employeeId = employeeId;
    }

    public TreeSet<MenuPrivilegeBO> getPrivileges() {
        return privileges;
    }

    public void setPrivileges(TreeSet<MenuPrivilegeBO> privileges) {
        this.privileges = privileges;
    }

    public void addPrivilege(MenuPrivilegeBO privilege) {
        privileges.add(privilege);
    }

    @Override
    public boolean equals(Object obj) {
        if (obj instanceof MenuBO) {
            return ((MenuBO) obj).id.equals(this.id);
        }
        return false;
    }
}
